/*
 * Copyright 2009 rashaguo <rashaguo@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

/*******************************************************
 *  Web server wrapper API
 *  Provide the following function:
 *  - start server
 *  - stop server
 *  - restart server
 *  - is running
 *  - get serve port
 ********************************************************/

#ifndef WEBSERVER_H
#define WEBSERVER_H
#include <string>

/// define this class to wrapper some specified struct used by concrete web server.
/// May be need to be improved in the future.
/// Here just to hide some details for the implement of the server.

class ServerContext;

class WebServerWrapper
{
public:

    WebServerWrapper();

    ~WebServerWrapper();

    int start();

    int stop();

    int restart();

    bool isRunning() const
    {
        return m_isRunning;
    }

    std::string getServerPort() const
    {
        return m_port;
    }

private:

    std::string m_port;

    bool m_isRunning;

    ServerContext *m_context;

};

#endif
